/* 导入字体 */
@font-face {
  font-family: "PuHuiTi";
  src: url("fonts/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.otf") format(".otf");
  font-weight: normal;
  font-style: normal;
}

/* 全局动画 */
* {
  transition: all 0.2s ease;
  box-sizing: border-box;
}

button,
select,
input,
.session-item,
textarea {
  background-color: rgba(72, 95, 108, .1);
  margin: .1rem;
  padding: .5rem;
  border: none;
  outline: none;
  border-radius: .5rem;
  cursor: pointer;
}

input,
textarea {
  width: 100%;
  cursor: initial;
}

button:hover,
select:hover,
.session-item:hover {
  background-color: rgba(255, 255, 255, .1);
}

/* 桌面端 */
@media only screen and (min-height: 760px) and (min-width: 1024px) {
  .not-max {
    max-height: 760px !important;
    max-width: 1024px !important;
    border-radius: 1rem;
    border: .1rem solid var(--bg-border-color);
    box-shadow: 0 0 200px rgba(0, 0, 0, .2);
  }

  .yaa-container.not-max .ctrl-panel {
    width: var(--ctrl-panel-width) !important;
  }

  .yaa-container.not-max .ctrl-panel .session .session-item {
    flex-direction: row !important;
  }
}

/* 定义全局变量 */
:root {
  /* 色 */
  --bg-border-color: #9E9E9E;
  --bg-color-light: #E6E6E6;
  --bg-color-dark: #485f6C;
  --content-border-color: #E0E0E0;
  --content-color-light: #F5F5F5;
  --content-color-dark: #618092;
  --font-color-light: #FAFAFA;
  --font-color-midium: #CCCCCC;
  --font-color-dark: #212121;
  /* 侧栏宽 */
  --ctrl-panel-width: 15rem;
  --sett-panel-width: 20rem;
  /* 标题栏高 */
  --header-height: 4rem;
}

/* 背景和主体 */
:root,
body {
  background-color: var(--bg-color-light);
  color: var(--font-color-dark);
  font-family: "PuHuiTi", "Open Sans", sans-serif;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0;
}

.yaa-container,
.not-max {
  background-color: var(--content-color-light);
  max-height: 100%;
  max-width: 100%;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  overflow: hidden;
}

.yaa-container.not-max .ctrl-panel {
  width: 4rem;
}

.yaa-container>* {
  border-right: .1rem solid var(--content-border-color);
}

.yaa-container>*:last-child {
  border-right: 0 solid transparent;
}

/* 栏 */
.yaa-container .panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-color-light);
  color: var(--font-color-dark);
  height: 100%;
}

.yaa-container .panel>* {
  border-bottom: .1rem solid var(--content-border-color);
}

.yaa-container .panel>*:last-child {
  border-bottom: 0 solid transparent;
}

/* 栏为关闭状态 */
.yaa-container .panel.closed {
  width: 0rem !important;
  border: none;
}

.yaa-container .panel .header {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  text-align: center;
  align-items: center;
  font-size: x-large;
  font-weight: bolder;
  padding: .5rem;
}

.yaa-container .panel .buttons {
  display: flex;
  gap: 1rem;
}

.yaa-container .panel .buttons button {
  display: flex;
  width: 2rem;
  height: 2rem;
  justify-content: center;
  align-items: center;
  background-size: 50%;
  background-position: center;
  background-repeat: no-repeat;
}

.yaa-container .panel .list {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .5rem;
}

/* 控制面板 */
.yaa-container .ctrl-panel {
  width: var(--ctrl-panel-width);
  background-color: var(--bg-color-dark);
  color: var(--font-color-light);
}

.yaa-container .ctrl-panel>* {
  border-bottom: .1rem solid var(--content-color-dark);
}

.yaa-container .ctrl-panel .header img {
  height: 3rem;
}

.yaa-container .ctrl-panel .header span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.yaa-container .ctrl-panel .header span,
.yaa-container .ctrl-panel .session {
  flex: 1;
}

.yaa-container .ctrl-panel .session {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .5rem;
}

.yaa-container .ctrl-panel .session .session-item {
  display: flex;
  flex-direction: row;
}

.yaa-container.not-max .ctrl-panel .session .session-item {
  flex-direction: column;
}

.yaa-container .ctrl-panel .session .session-item .session-info {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
  text-align: left;
}

.yaa-container .ctrl-panel .session .session-item .delete-session-btn {
  width: 1.5rem;
  height: 1.5rem;
  background-color: #FF6B6B;
}

.yaa-container .ctrl-panel .session .session-item .delete-session-btn:hover {
  background-color: #FF5252;
}

.yaa-container .ctrl-panel .session .session-item .session-item-content,
.yaa-container .ctrl-panel .session .session-item .session-item-time {
  color: var(--font-color-midium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yaa-container .ctrl-panel .session .session-item .session-item-content {
  font-size: medium;
}

.yaa-container .ctrl-panel .session .session-item .session-item-time {
  font-size: small;
}

.yaa-container .ctrl-panel .btn.list {
  height: 20%;
  justify-content: space-between;
}

.yaa-container .ctrl-panel .btn button {
  color: var(--font-color-light);
}

/* 设置面板 */
.yaa-container .sett-panel {
  width: var(--sett-panel-width);
  background-color: white;
  text-align: left;
}

.yaa-container .sett-panel .header {
  padding: 1rem;
}

.yaa-container .sett-panel .header .head-title {
  font-size: x-large;
  font-weight: bolder;
}

.yaa-container .sett-panel .sett-block {
  overflow-y: scroll;
  overflow-x: clip;
  padding: 1rem;
}

.yaa-container .sett-panel .sett-block>*:first-child {
  margin-top: 0;
}

.yaa-container .sett-panel .sett-block>*:last-child {
  margin-bottom: 0;
}

/* 交互面板 */
.yaa-container .chat-panel {
  flex: 1;
  justify-content: space-between;
}

.yaa-container .chat-panel .header {
  background-color: white;
  display: flex;
  text-align: center;
  align-items: center;
  font-size: x-large;
  font-weight: bolder;
  padding: 1rem;
}

.yaa-container .chat-panel .header span {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin: 1rem;
}

.yaa-container .chat-panel .content {
  display: flex;
  justify-content: center;
  overflow-x: clip;
  overflow-y: scroll;
  flex: 1;
}

.yaa-container .chat-panel .content .width-768 {
  padding: 1rem 1rem 0 1rem;
  max-width: 768px;
  width: 100%;
  height: max-content;
}

.yaa-container .chat-panel .input {
  display: flex;
  height: 20%;
  padding: .5rem;
  gap: .5rem;
  justify-content: space-between;
  background-color: white;
}

.yaa-container .chat-panel .input textarea {
  font: inherit;
  flex: 1;
  resize: none;
  overflow: auto;
}

.yaa-container .chat-panel .input .buttons {
  display: flex;
  flex-direction: column-reverse;
  gap: .5rem;
}

/* 内容气泡 */
.yaa-container .chat-panel .content .object {
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
}

.yaa-container .chat-panel .content .object.user {
  flex-direction: row-reverse;
}

/* 气泡尖伪元素 */
/* .yaa-container .chat-panel .content .object.system:before,
.yaa-container .chat-panel .content .object.assistant:before {
  content: "";
  position: relative;
  max-width: 0;
  max-height: 0;
  border-left: 10px solid transparent;
  border-top: 10px solid transparent;
  border-right: 10px solid #fff;
  border-bottom: 10px solid transparent;
  left: 60px;
  top: 10px;
} */

.yaa-container .chat-panel .content .object .avatar {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  background-size: cover;
  background-color: #FAFDFF;
  border-radius: 50%;
  box-shadow: 0 0 200px rgba(0, 0, 0, .2);
}

.yaa-container .chat-panel .content .object .bubble {
  text-align: left;
  overflow: hidden;
  border-radius: 0 1rem 1rem 1rem;
  padding: 1rem;
  word-wrap: break-word;
  word-break: normal;
  background-color: #FAFDFF;
  box-shadow: 0 0 200px rgba(0, 0, 0, .2);
}

.yaa-container .chat-panel .content .object.user .bubble {
  border-radius: 1rem 0 1rem 1rem;
}

.yaa-container .chat-panel .content .object.system .avatar,
.yaa-container .chat-panel .content .object.system .bubble {
  background-color: #FFFAFA;
}